package cn.gwm.flink.streaming.dwd.streamsource;

import cn.hutool.core.lang.UUID;
import cn.hutool.json.JSONObject;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.io.Serializable;

/**
 * @ClassName StreamSource
 * @Description
 * @Author LiangGuang
 * @Date 2023/05/24 10:06
 */
@Data
@Accessors(chain = true)
public abstract class StreamSource implements Serializable {
    public String uidSuffix = UUID.randomUUID().toString();

    public abstract DataStream<JSONObject> source(StreamExecutionEnvironment env, String groupId, String topic);
}
